
/**删除用户**/
function deleteUser(deleteIds) {
	var current = window.parent.document.getElementById("current");
	if(deleteIds!=""){//删除单个用户
		if(confirm("确定要删除此用户？")){ //deleteIds为用户ID，page为当前分页
			window.location.href = "deleteUser?&deleteIds=" + deleteIds +"&page=" + current.value;
		}else{
			return false;
		}
	}else{//批量删除用户
		
		var recordIds = document.getElementsByName("recordIds");
		var recordStr = "";
		for(var i=0; i<recordIds.length; i++){
			if(recordIds[i].checked){
				recordStr += recordIds[i].value + "|";
			}
		}
		if(recordStr==""){
			alert("没有选中任何用户！");
		}else{
			if(confirm("确定要删除选中的用户？")){ //deleteIds为用户ID，page为当前分页
				window.location.href = "deleteUser?&deleteIds=" + recordStr +"&page=" + current.value;
			}else{
				return false;
			}
		}
	}
};


/**重置用户密码**/
function resetPass(userId) {
	var src = "resetPassForm?&userId=" + userId;
	window.parent.frames.msgBox('resetPassBox', '重置用户密码',"resetPassIframe",src);
};

/**修改用户**/
function updateUser(userId) {
	var src = "userInfo?&userId=" + userId;
	window.parent.frames.msgBox('userInfoBox', '用户信息',"userInfoIframe",src);
};

/**选中所有记录**/
var CLICK_SELECT = false;
function allSelected() {
	CLICK_SELECT = !CLICK_SELECT;
	var recordIds = document.getElementsByName("recordIds");
	for(var i=0; i<recordIds.length; i++){
		if(CLICK_SELECT){
			recordIds[i].checked =true;
		}else{
			recordIds[i].checked ="";
		}
	}
};
